//  编写一个person类
class Person {
  public name: string; // ts 4.0之前 没有赋值的解决办法 要使用|undefined 或者赋值初始值
  public age: number;
  public phone: string;

  constructor(name: string, age: number, phone: string) {
    this.name = name;
    this.age = age;
    this.phone = phone;
  }


  // 定义方法
  public doEat(who: string, where: string): void {
    console.log(`${this.name}在${where}跟${who}吃东西`);
  }

  // 函数类型
  public doShow:()=>void;
}

const zhangshan = new Person('张三',12,'1111');
zhangshan.doEat('王五','天河城')
console.log(zhangshan);
